package main

import (
	"edata-hub/pkg/server"
	"flag"
	"fmt"
	"log"
	"os"
)

func main() {
	var join string
	flag.StringVar(&join, "join", "192.168.36.1:8010", "Add to an existing Master as a Follower")
	var confPath string
	flag.StringVar(&confPath, "confPath", "configs/application.yml", "The path of the conf file")
	flag.Parse()
	banner, _ := os.ReadFile("configs/banner")
	fmt.Println(string(banner))
	config, _ := server.ReadConfig(confPath)
	log.Printf("INFO running as master")
	master := server.Master{}
	master.Config = config
	master.Join = join
	master.StartServer()
}
